#ifndef __G_THREAD__
#define __G_THREAD__

#include <pthread.h>
#include "common.h"
#include <assert.h>
#include "NoCopyable.h"

class CThread:private G_NoCopyable
{
	public:
		CThread();
		virtual ~CThread();
		pthread_t getThreadId();
		bool Start();

		void pause();

		void continues();

	private:
		void maskSIGUSR1();

		pthread_t m_pid;

		sigset_t m_waitSig;

		static void *threadFun(void *arg);
	protected:
		virtual void Run() = 0;
};

#endif

